using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Elementum
{
    class PositionModifier : Modifier
    {
        Vector2 _startPoint;
        Vector2 _endPoint;
        Vector2 _speed;

        public PositionModifier(Vector2 startPoint,Vector2 endPoint,int start,int end):base(start,end) {
            _startPoint = startPoint;
            _endPoint = endPoint;
            _speed = (endPoint - startPoint) / (end - start);
        }

        protected override void OnModify()
        {
            if (_counter == _start)
                _registor.Position = _startPoint;
            _registor.Position += _speed;
        }
    }
}
